maintainer="Marian Buschsieweke <marian.buschsieweke@posteo.net>"
pkgname=py3-pytest-regtest
pkgver=2.3.1
pkgrel=0
pkgdesc="pytest-regtest is a pytest-plugin for implementing regression tests"
url="https://gitlab.com/uweschmitt/pytest-regtest"
# loongarch64: blocked by twine
arch="noarch !loongarch64"
license="MIT"
depends="
	py3-pytest
	"
makedepends="
	py3-gpep517
	py3-hatchling
	py3-setuptools
	py3-wheel
	twine
	"
checkdepends="
	py3-pexpect
	py3-tox
	py3-pandas
	"
subpackages="$pkgname-pyc"
source="
	https://gitlab.com/uweschmitt/pytest-regtest/-/archive/$pkgver/pytest-regtest-$pkgver.tar.bz2
	"
builddir="$srcdir/pytest-regtest-$pkgver"

build() {
	gpep517 build-wheel \
		--wheel-dir .dist \
		--output-fd 3 3>&1 >&2
}

check() {
	python3 -m venv --clear --without-pip --system-site-packages test-env
	test-env/bin/python3 -m installer .dist/*.whl
	test-env/bin/python3 -m pytest \
		--deselect develop_tests/test_regtest.py::test_regtest \
		--deselect develop_tests/test_regtest.py::test_always_fail \
		--deselect develop_tests/test_regtest.py::test_always_fail_regtest \
		--deselect develop_tests/test_regtest.py::test_only_fail_regtest \
		--deselect develop_tests/test_regtest.py::test_with_paramertrization \
		--deselect develop_tests/test_regtest.py::test_with_paramertrization \
		--deselect tests/test_cli.py::test_cli \
		--deselect tests/test_cli.py::test_tee \
		--deselect tests/test_regtest.py::test_regtest_context_manager \
		--deselect tests/test_regtest.py::test_regtest_fh \
		--deselect tests/test_regtest.py::test_regtest_all \
		--deselect tests_dev/test_demo.py::test_squares_up_to_ten \
		--deselect tests_dev/test_direct.py::test_regtest \
		--deselect tests_dev/test_direct.py::test_regtest_all \
		--deselect tests_dev/test_direct.py::test_with_paramertrization \
		--deselect tests_dev/test_direct.py::test_with_paramertrization \
		--deselect tests_dev/test_direct.py::test_with_very_long_name \
		--deselect tests_dev/test_direct.py::test_snapshot \
		--deselect tests_dev/test_snapshot.py::test_snapshot_numpy_1d \
		--deselect tests_dev/test_snapshot.py::test_snapshot_object \
		--deselect tests/test_snapshot_polars.py::test_snapshot_polars_changed_entry \
		--deselect tests/test_snapshot_polars.py::test_snapshot_polars_empty_diff \
		--deselect tests/test_snapshot_polars.py::test_snapshot_polars_rtol_atol \
		--deselect tests/test_snapshot_polars.py::test_snapshot_polars_diff_num_columns \
		#
}

package() {
	python3 -m installer -d "$pkgdir" \
		.dist/*.whl
}

sha512sums="
ce308314d0d9bb3fe160367cae818552be95399bab1081402ebb64cc631f6640a2d10a44e079d85b9907aaed4471fd52c9448729888b2769eb32334f4141112e  pytest-regtest-2.3.1.tar.bz2
"
